package likou;

/**
 * @author: 唐小尊
 * @email: 1171702529@qq.com
 * @cate: 2021/05/31 07:15
 */
public class _523 {
    public static void main(String[] args) {
        System.out.println(checkSubarraySum(new int[]{0,0},1));
    }
    public static boolean checkSubarraySum(int[] nums, int k) {
        int n = nums.length;
        int[] sumL = new int[n + 1];
        sumL[0] = 0;
        for (int i = 0; i < n; i++) {
            sumL[i + 1] = sumL[i] + nums[i];
        }
        for (int i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                int now = sumL[j] - sumL[i];
                if (j - i > 1 && now % k == 0) {
                    return true;
                }
            }
        }
        return false;
    }
}
